# -*- coding: utf-8 -*-
#
# File: jobapplication.py
#
# Copyright (c) 2008 by ['JC Brand']
# Generator: ArchGenXML Version 2.0
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """JC Brand <jc@upfrontsystems.co.za>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.mycrew.config import *

# additional imports from tagged value 'import'
from Products.ATContentTypes.content.document import ATDocument

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='name',
        widget=StringField._properties['widget'](
            description="Please enter your full name",
            label='Name',
            label_msgid='mycrew_label_name',
            description_msgid='mycrew_help_name',
            i18n_domain='mycrew',
        ),
        required=True,
        searchable=True,
    ),
    DateTimeField(
        name='birthDate',
        widget=DateTimeField._properties['widget'](
            show_hm=False,
            label="Date of Birth",
            label_msgid='mycrew_label_birthDate',
            i18n_domain='mycrew',
        ),
        required=True,
    ),
    TextField(
        name='address',
        widget=TextAreaWidget(
            description="Please enter your physical address of residence",
            label='Address',
            label_msgid='mycrew_label_address',
            description_msgid='mycrew_help_address',
            i18n_domain='mycrew',
        ),
    ),
    StringField(
        name='email',
        widget=StringField._properties['widget'](
            label='Email',
            label_msgid='mycrew_label_email',
            i18n_domain='mycrew',
        ),
        validators=('isEmail',),
    ),
    StringField(
        name='telephone',
        widget=StringField._properties['widget'](
            label='Telephone',
            label_msgid='mycrew_label_telephone',
            i18n_domain='mycrew',
        ),
        required=True,
    ),
    BooleanField(
        name='hasDrivers',
        widget=BooleanField._properties['widget'](
            label="I have a driver's license",
            label_msgid='mycrew_label_hasDrivers',
            i18n_domain='mycrew',
        ),
    ),
),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

JobApplication_schema = BaseSchema.copy() + \
    getattr(ATDocument, 'schema', Schema(())).copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
JobApplication_schema['text'].widget.label = "Why am I the best candiate for the Job?"
##/code-section after-schema

class JobApplication(BaseContent, ATDocument, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(interfaces.IJobApplication)

    meta_type = 'JobApplication'
    _at_rename_after_creation = True

    schema = JobApplication_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(JobApplication, PROJECTNAME)
# end of class JobApplication

##code-section module-footer #fill in your manual code here
##/code-section module-footer



